![]() |
PATH![]() |
![]() ![]() |
An Exit statement is used in a Repeat statement to exit the Repeat statement. When AppleScript executes an Exit statement, it terminates loop execution and resumes execution with the next statement following the Repeat statement. You cannot use Exit statements outside of Repeat statements.
For more information on the following script, see the example in Repeat (forever).
tell application "AppleWorks"
set numberOfDocuments to (count documents)
set i to 1
repeat
if i > numberOfDocuments then
exit repeat
end if
print document i one copy false -- display Print dialog
close document i saving ask -- ask before saving modified doc
set i to i + 1
end repeat
end tell